﻿// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
//
// 本项目主要遵循 MIT 许可证和 Apache 许可证（版本 2.0）进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
//
// 不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！

using Admin.NET.Core;
using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Magicodes.ExporterAndImporter.Excel;
using Admin.NET.Application.Entity;

namespace Admin.NET.Application;

/// <summary>
/// 入库申请基础输入参数
/// </summary>
public class StoreInboundBaseInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    public virtual long? Id { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>
    public virtual long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 物资
    /// </summary>
    public virtual long? MaterialId { get; set; }
    
    /// <summary>
    /// 申请数量
    /// </summary>
    public virtual decimal? Quantity { get; set; }
    
    /// <summary>
    /// 申请人ID
    /// </summary>
    public virtual long? ApplicantId { get; set; }
    
    /// <summary>
    /// 接收人Id
    /// </summary>
    public virtual long? ReceiverId { get; set; }
    
    /// <summary>
    /// 预期时间
    /// </summary>
    public virtual DateTime? ExpectedDate { get; set; }
    
    /// <summary>
    /// 新增或更新
    /// </summary>
    [Dict(nameof(StatusNewOrChangeEnum), AllowNullValue=true)]
    [Required(ErrorMessage = "新增或更新不能为空")]
    public virtual StatusNewOrChangeEnum? StatusNewOrChange { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    public virtual string? Remark { get; set; }
    
}

/// <summary>
/// 入库申请分页查询输入参数
/// </summary>
public class PageStoreInboundInput : BasePageInput
{
    /// <summary>
    /// 申请批次
    /// </summary>
    public string? BatchNo { get; set; }
    
    /// <summary>
    /// 申请号
    /// </summary>
    public string RequestNo { get; set; }
    
    /// <summary>
    /// 分类名称
    /// </summary>
    public string? StoreTypeName { get; set; }
    
    /// <summary>
    /// 物资名称
    /// </summary>
    public string? MaterialName { get; set; }
    
    /// <summary>
    /// 申请人姓名
    /// </summary>
    public string? ApplicantName { get; set; }
    
    /// <summary>
    /// 接收人姓名
    /// </summary>
    public string? ReceiverName { get; set; }
    
    /// <summary>
    /// 申请时间范围
    /// </summary>
     public DateTime?[] RequestTimeRange { get; set; }
    
    /// <summary>
    /// 新增或更新
    /// </summary>
    [Dict(nameof(StatusNewOrChangeEnum), AllowNullValue=true)]
    public StatusNewOrChangeEnum? StatusNewOrChange { get; set; }
    
    /// <summary>
    /// 选中主键列表
    /// </summary>
     public List<long> SelectKeyList { get; set; }
}

/// <summary>
/// 入库申请增加输入参数
/// </summary>
public class AddStoreInboundInput: StoreInbound
{
    
}

/// <summary>
/// 入库申请删除输入参数
/// </summary>
public class DeleteStoreInboundInput
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
}

/// <summary>
/// 入库申请更新输入参数
/// </summary>
public class UpdateStoreInboundInput
{
    /// <summary>
    /// 主键Id
    /// </summary>    
    [Required(ErrorMessage = "主键Id不能为空")]
    public long? Id { get; set; }
    
    /// <summary>
    /// 分类
    /// </summary>    
    public long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 物资
    /// </summary>    
    public long? MaterialId { get; set; }
    
    /// <summary>
    /// 申请数量
    /// </summary>    
    public decimal? Quantity { get; set; }
    
    /// <summary>
    /// 申请人ID
    /// </summary>    
    public long? ApplicantId { get; set; }
    
    /// <summary>
    /// 接收人Id
    /// </summary>    
    public long? ReceiverId { get; set; }
    
    /// <summary>
    /// 预期时间
    /// </summary>    
    public DateTime? ExpectedDate { get; set; }
    
    /// <summary>
    /// 新增或更新
    /// </summary>    
    [Dict(nameof(StatusNewOrChangeEnum), AllowNullValue=true)]
    [Required(ErrorMessage = "新增或更新不能为空")]
    public StatusNewOrChangeEnum? StatusNewOrChange { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>    
    [MaxLength(128, ErrorMessage = "备注字符长度不能超过128")]
    public string? Remark { get; set; }
    
}

/// <summary>
/// 入库申请主键查询输入参数
/// </summary>
public class QueryByIdStoreInboundInput : DeleteStoreInboundInput
{
}

/// <summary>
/// 下拉数据输入参数
/// </summary>
public class DropdownDataStoreInboundInput
{
    /// <summary>
    /// 是否用于分页查询
    /// </summary>
    public bool FromPage { get; set; }
}

/// <summary>
/// 入库申请数据导入实体
/// </summary>
[ExcelImporter(SheetIndex = 1, IsOnlyErrorRows = true)]
public class ImportStoreInboundInput : BaseImportInput
{
    /// <summary>
    /// 分类 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? StoreTypeId { get; set; }
    
    /// <summary>
    /// 分类 文本
    /// </summary>
    [ImporterHeader(Name = "分类")]
    [ExporterHeader("分类", Format = "", Width = 25, IsBold = true)]
    public string StoreTypeDisplayName { get; set; }
    
    /// <summary>
    /// 物资 关联值
    /// </summary>
    [ImporterHeader(IsIgnore = true)]
    [ExporterHeader(IsIgnore = true)]
    public long? MaterialId { get; set; }
    
    /// <summary>
    /// 物资 文本
    /// </summary>
    [ImporterHeader(Name = "物资")]
    [ExporterHeader("物资", Format = "", Width = 25, IsBold = true)]
    public string MaterialFkDisplayName { get; set; }
    
    /// <summary>
    /// 申请数量
    /// </summary>
    [ImporterHeader(Name = "申请数量")]
    [ExporterHeader("申请数量", Format = "", Width = 25, IsBold = true)]
    public decimal? Quantity { get; set; }
    
    /// <summary>
    /// 申请人ID
    /// </summary>
    [ImporterHeader(Name = "申请人ID")]
    [ExporterHeader("申请人ID", Format = "", Width = 25, IsBold = true)]
    public long? ApplicantId { get; set; }
    
    /// <summary>
    /// 接收人Id
    /// </summary>
    [ImporterHeader(Name = "接收人Id")]
    [ExporterHeader("接收人Id", Format = "", Width = 25, IsBold = true)]
    public long? ReceiverId { get; set; }
    
    /// <summary>
    /// 预期时间
    /// </summary>
    [ImporterHeader(Name = "预期时间")]
    [ExporterHeader("预期时间", Format = "yyyy-MM-dd", Width = 25, IsBold = true)]
    public DateTime? ExpectedDate { get; set; }
    
    /// <summary>
    /// 新增或更新
    /// </summary>
    [ImporterHeader(Name = "*新增或更新")]
    [ExporterHeader("*新增或更新", Format = "", Width = 25, IsBold = true)]
    public StatusNewOrChangeEnum? StatusNewOrChange { get; set; }
    
    /// <summary>
    /// 备注
    /// </summary>
    [ImporterHeader(Name = "备注")]
    [ExporterHeader("备注", Format = "", Width = 25, IsBold = true)]
    public string? Remark { get; set; }
    
}
